/**
 * 接受主进程message-to-ai-from-main-window
 * 1. 获取message
 * 2. 页面显示message
 * 3. 返回主进程已接收到信息
 */
import { useEffect, useState } from 'react';
import ElectronIPCGuide from './doc/doc';

import './index.scss';

function ReceiveWindowPage() {
  const [message, setMessage] = useState('');
  useEffect(() => {
    window.electronAPI.onMsgFromMainWindowThenReturn((msg: string) => {
      setMessage(msg);
    });
  }, []);
  return (
    <div className="receive-window-page-conatiner">
      接受到的内容： {message}
      <div className="ipc-docx-wrap">
        <ElectronIPCGuide />
      </div>
    </div>
  );
}

export default ReceiveWindowPage;
